package com.example.controller;

import com.example.feignApi.ProductFeignApi;
import com.example.mall.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName OrderController
 * @Description TODO
 * @Author: XMK
 * @Date: 2020/4/3 11:04
 * @Version: 1.0
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private ProductFeignApi productFeignApi;

    @GetMapping("/index")
    public List<Product> index() {
        return productFeignApi.selectProductListByType("phone");
    }

    @GetMapping("/token")
    public String getAccessToken() {
        return productFeignApi.getAccessToken("#EDF78ik");
    }

}
